package cn.net.asiacom.entity;


import com.fasterxml.jackson.databind.ObjectMapper;

import java.math.BigDecimal;

public class Ticket {
    /**
     * 发票号码
     */
    private String number;
    /**
     * 开票日期
     */
    private String date;
    /**
     * 票价
     */
    private BigDecimal amount;
    /**
     * 始发站
     */
    private String departureStation;
    /**
     * 终点站
     */
    private String destinationStation;
    /**
     * 车次
     */
    private String trainNumber;
    /**
     * 始发日期
     */
    private String departureDate;
    /**
     * 始发时间
     */
    private String departureTime;
    /**
     * 座位号
     */
    private String seatNumber;
    /**
     * 座位类型
     */
    private String seatType;
    /**
     * 乘客姓名
     */
    private String passengerName;
    /**
     * 乘客身份证号
     */
    private String passengerNumber;
    /**
     * 电子发票号码
     */
    private String eTicketNumber;
    /**
     * 购买方名称
     */
    private String buyerName;
    /**
     * 统一社会信用代码
     */
    private String socialCreditCode;

    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }

    public String getDate() {
        return date;
    }
    public void setDate(String date) {
        this.date = date;
    }

    public BigDecimal getAmount() {
        return amount;
    }
    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getDepartureStation() {
        return departureStation;
    }
    public void setDepartureStation(String departureStation) {
        this.departureStation = departureStation;
    }

    public String getDestinationStation() {
        return destinationStation;
    }
    public void setDestinationStation(String destinationStation) {
        this.destinationStation = destinationStation;
    }

    public String getTrainNumber() {
        return trainNumber;
    }
    public void setTrainNumber(String trainNumber) {
        this.trainNumber = trainNumber;
    }

    public String getDepartureDate() {
        return departureDate;
    }
    public void setDepartureDate(String departureDate) {
        this.departureDate = departureDate;
    }

    public String getDepartureTime() {
        return departureTime;
    }
    public void setDepartureTime(String departureTime) {
        this.departureTime = departureTime;
    }

    public String getSeatNumber() {
        return seatNumber;
    }
    public void setSeatNumber(String seatNumber) {
        this.seatNumber = seatNumber;
    }

    public String getSeatType() {
        return seatType;
    }
    public void setSeatType(String seatType) {
        this.seatType = seatType;
    }

    public String getPassengerName() {
        return passengerName;
    }
    public void setPassengerName(String passengerName) {
        this.passengerName = passengerName;
    }

    public String getPassengerNumber() {
        return passengerNumber;
    }
    public void setPassengerNumber(String passengerNumber) {
        this.passengerNumber = passengerNumber;
    }

    public String getETicketNumber() {
        return eTicketNumber;
    }
    public void setETicketNumber(String eTicketNumber) {
        this.eTicketNumber = eTicketNumber;
    }

    public String getBuyerName() {
        return buyerName;
    }
    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }
    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    @Override
    public String toString() {
        ObjectMapper mapper = new ObjectMapper();
        try {
            return mapper.writeValueAsString(this);
        } catch (Exception e) {
            return "Ticket{" +
                    "number='" + number + '\'' +
                    ", date='" + date + '\'' +
                    ", amount=" + amount +
                    ", departureStation='" + departureStation + '\'' +
                    ", destinationStation='" + destinationStation + '\'' +
                    ", trainNumber='" + trainNumber + '\'' +
                    ", departureDate='" + departureDate + '\'' +
                    ", departureTime='" + departureTime + '\'' +
                    ", seatNumber='" + seatNumber + '\'' +
                    ", seatType='" + seatType + '\'' +
                    ", passengerName='" + passengerName + '\'' +
                    ", passengerNumber='" + passengerNumber + '\'' +
                    ", eTicketNumber='" + eTicketNumber + '\'' +
                    ", buyerName='" + buyerName + '\'' +
                    ", socialCreditCode='" + socialCreditCode + '\'' +
                    '}';
        }
    }
}
